//
//  AssetViewController.m
//  project
//
//  Created by 张亚林 on 2017/10/25.
//  Copyright © 2017年 Macmini. All rights reserved.
//

#import "AssetViewController.h"


#import "BottomView.h"

@interface AssetViewController ()

@property (weak, nonatomic) IBOutlet UIView *contentView;

@property (nonatomic, retain)BottomView *chongzhiView;
@property (nonatomic, retain)BottomView *tibiView;
@property (weak, nonatomic) IBOutlet NSLayoutConstraint *contentLead;


@end

@implementation AssetViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    [self setupNavBar];
    
    [self creatUI];
}

- (void)setupNavBar {
    self.navigationItem.title = @"我的资产";
    
    UIButton *rightBtn = [UIButton buttonWithType:UIButtonTypeCustom];
    [rightBtn setTitle:@"帮助" forState:UIControlStateNormal];
    [rightBtn setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
    
    UIBarButtonItem *rightBarButtonItem = [[UIBarButtonItem alloc] initWithCustomView:rightBtn];
    self.navigationItem.rightBarButtonItem = rightBarButtonItem;
    
}

- (void)creatUI {
    
    //添加充值view
    self.chongzhiView = [[NSBundle mainBundle]loadNibNamed:@"BottomView" owner:nil options:nil].firstObject;
    //添加提币view
    self.tibiView = [[NSBundle mainBundle]loadNibNamed:@"BottomView" owner:nil options:nil].lastObject;
    
    [self.contentView addSubview:_chongzhiView];
    [self.contentView addSubview:_tibiView];
    
}

- (IBAction)clickChongzhiBtn:(id)sender {
    self.contentLead.constant = 0;
    [UIView animateWithDuration:0.1 animations:^{
        [self.view layoutIfNeeded];
        
    }];
}

- (IBAction)clickTibiBtn:(id)sender {
    
    NSLog(@"%@", _tibiView);
    self.contentLead.constant = - 375;
    [UIView animateWithDuration:0.1 animations:^{
        [self.view layoutIfNeeded];
        
    }];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}



@end
